{% extends "base.html" %}
{% block title %}电梯信息{% endblock %}
{% block css %}
<link rel="stylesheet" href="/lift_base/static/src/css/style.css">
{% endblock %}
{% block content %}
<div class="container">
    <div class="panel-msg">
        <!--基本信息-->
        <div class="row">
            <div class="col-xs-12">
                <h5><i class="fa fa-file-text-o"></i>基本信息</h5>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-6">
                <label>电梯编号</label>
                <p>{{lift.code if lift.code else ''}}</p>
            </div>
        <!--</div>-->
        <!--<div class="row">-->
            <div class="col-xs-6">
                <label>电梯状态</label>
                <p>
                    {% if lift.lift_status == 'using' %}
                    在用
                    {% elif lift.lift_status == 'unused' %}
                    停用
                    {% elif lift.lift_status == 'cancel' %}
                    注销
                    {% else %}
                    &nbsp;
                    {% endif %}
                </p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>注册编码</label>
                <p>{{lift.register_code if lift.register_code else ''}}</p>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12">
                <label>生产厂家</label>
                <p>{{lift.factory_id.name if lift.factory_id.name else ''}}</p>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12">
                <label>电梯型号</label>
                <p>{{lift.model_id.name if lift.model_id.name else ''}}</p>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12">
                <label>电梯地址</label>
                <p>{{lift.city_id.name}}{{lift.area_id.name}}{{lift.use_address if lift.use_address else ''}}</p>
            </div>
        </div>
        <!--基本信息-->
        <!--使用单位信息-->
        <div class="row">
            <div class="col-xs-12">
                <h5><i class="fa fa-file-text-o"></i>使用单位信息</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>使用单位</label>
                <p>{{lift.use_company_id.name if lift.use_company_id.name else ''}}</p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-6">
                <label>联系人</label>
                <p>{{lift.use_company_id.linkman if lift.use_company_id.linkman else ''}}</p>
            </div>
            <div class="col-xs-6">
                <label>联系电话</label>
                <p>
                    {% if lift.use_company_id.linkman_tel %}
                    <a href="tel://{{lift.use_company_id.linkman_tel}}">{{lift.use_company_id.linkman_tel}}</a>
                    {% endif %}
                    {% if lift.use_company_id.linkman_phone %}
                    <a href="tel://{{lift.use_company_id.linkman_phone}}">{{lift.use_company_id.linkman_phone}}</a>
                    {% endif %}
                </p>
            </div>
        </div>
        <!--使用单位信息-->
        <!--维保单位信息-->
        <div class="row">
            <div class="col-xs-12">
                <h5><i class="fa fa-file-text-o"></i>维保单位信息</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>维保单位</label>
                <p>{{lift.maintenance_company_id.name if lift.maintenance_company_id.name else ''}}</p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>维保星级</label>
                <p>{{lift.maintenance_star if lift.maintenance_star else ''}}</p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-6">
                <label>上次维保日期</label>
                <p>{{lift.last_maintenance_date or ''}}</p>
            </div>
            <div class="col-xs-6">
                <label>下次维保时间</label>
                <p>{{lift.last_maintenance_date | adddays(15)}}</p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-6">
                <label>联系人</label>
                <p>{{lift.maintenance_company_id.contact if lift.maintenance_company_id.contact else ''}}</p>
            </div>
            <div class="col-xs-6">
                <label>联系电话</label>
                <p>
                    {% if lift.maintenance_company_id.phone %}
                    <a href="tel://{{lift.maintenance_company_id.phone}}">{{lift.maintenance_company_id.phone}}</a>
                    {% endif %}
                    {% if lift.maintenance_company_id.mobile %}
                    <a href="tel://{{lift.maintenance_company_id.mobile}}">{{lift.maintenance_company_id.mobile}}</a>
                    {% endif %}
                </p>
            </div>
        </div>
        <!--维保单位信息-->
        <!--检验信息-->
        <div class="row">
            <div class="col-xs-12">
                <h5><i class="fa fa-file-text-o"></i>检验信息</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-6">
                <label>上次检验时间</label>
                <p>{{lift.last_check_date if lift.last_check_date else ''}}</p>
            </div>
            <div class="col-xs-6">
                <label>下次检验时间</label>
                <p>{{lift.next_check_date if lift.next_check_date else ''}}</p>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <label>检验结论</label>
                <p>
                    {% if lift.checkout_result == 'no' %}
                    <!--{{no_name}}-->
                    不合格
                    {% elif lift.checkout_result == 're_ok' %}
                    复检合格
                    {% elif lift.checkout_result == 're_no' %}
                    复检不合格
                    {% elif lift.checkout_result == 'corrective' %}
                    整改期间
                    {% else %}
                    合格
                    {% endif %}
                </p>
            </div>
        </div>
        {% if has_bind=='no' %}
        <div class="row">
            <div class="col-xs-8 col-xs-offset-2 text-center">
                <p>
                    <button class="btn btn-warning btn-block" onclick="window.location.href='http://zumd.chinaganzhi.com/main/lift/detail/{{code}}'">继续绑定</button>
                </p>
            </div>
        </div>
        {% endif %}
                
        <!--检验信息-->
        <!--最新公告-->
        {% if notice %}
        <div class="row">
            <div class="col-xs-12">
                <h5><i class="fa fa-file-text-o"></i>最新公告</h5>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div class="news-title text-center">{{notice.title}}</div>
                <div class="news-date text-center">{{notice.send_time}}</div>
                <div class="news-content clearfix">
                    {{notice.content | safe}}
                </div>
            </div>
        </div>
        {% endif %}
        <!--最新公告-->
    </div>

</div>
{% endblock %}